home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / Apache 1.0 / src / http_request.h < prev    next >
Text File  |  1995-12-04  |  4KB  |  93 lines

  1.  
  2. /* ====================================================================
  3.  * Copyright (c) 1995 The Apache Group.  All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  *
  9.  * 1. Redistributions of source code must retain the above copyright
  10.  *    notice, this list of conditions and the following disclaimer. 
  11.  *
  12.  * 2. Redistributions in binary form must reproduce the above copyright
  13.  *    notice, this list of conditions and the following disclaimer in
  14.  *    the documentation and/or other materials provided with the
  15.  *    distribution.
  16.  *
  17.  * 3. All advertising materials mentioning features or use of this
  18.  *    software must display the following acknowledgment:
  19.  *    "This product includes software developed by the Apache Group
  20.  *    for use in the Apache HTTP server project (http://www.apache.org/)."
  21.  *
  22.  * 4. The names "Apache Server" and "Apache Group" must not be used to
  23.  *    endorse or promote products derived from this software without
  24.  *    prior written permission.
  25.  *
  26.  * 5. Redistributions of any form whatsoever must retain the following
  27.  *    acknowledgment:
  28.  *    "This product includes software developed by the Apache Group
  29.  *    for use in the Apache HTTP server project (http://www.apache.org/)."
  30.  *
  31.  * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
  32.  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  33.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  34.  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
  35.  * IT'S CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  36.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  37.  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  38.  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  39.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  40.  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  41.  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  42.  * OF THE POSSIBILITY OF SUCH DAMAGE.
  43.  * ====================================================================
  44.  *
  45.  * This software consists of voluntary contributions made by many
  46.  * individuals on behalf of the Apache Group and was originally based
  47.  * on public domain software written at the National Center for
  48.  * Supercomputing Applications, University of Illinois, Urbana-Champaign.
  49.  * For more information on the Apache Group and the Apache HTTP server
  50.  * project, please see <http://www.apache.org/>.
  51.  *
  52.  */
  53.  
  54.  
  55. /* http_request.c is the code which handles the main line of request
  56.  * processing, once a request has been read in (finding the right per-
  57.  * directory configuration, building it if necessary, and calling all
  58.  * the module dispatch functions in the right order).
  59.  *
  60.  * The pieces here which are public to the modules, allow them to learn
  61.  * how the server would handle some other file or URI, or perhaps even
  62.  * direct the server to serve that other file instead of the one the
  63.  * client requested directly.
  64.  *
  65.  * There are two ways to do that.  The first is the sub_request mechanism,
  66.  * which handles looking up files and URIs as adjuncts to some other
  67.  * request (e.g., directory entries for multiviews and directory listings);
  68.  * the lookup functions stop short of actually running the request, but
  69.  * (e.g., for includes), a module may call for the request to be run
  70.  * by calling run_sub_req.  The space allocated to create sub_reqs can be
  71.  * reclaimed by calling destroy_sub_req --- be sure to copy anything you care
  72.  * about which was allocated in its pool elsewhere before doing this.
  73.  */
  74.  
  75. request_rec *sub_req_lookup_uri (char *new_file, request_rec *r);
  76. request_rec *sub_req_lookup_file (char *new_file, request_rec *r);
  77. int run_sub_req (request_rec *r);
  78. void destroy_sub_req (request_rec *r);
  79.      
  80. /*
  81.  * Then there's the case that you want some other request to be served
  82.  * as the top-level request INSTEAD of what the client requested directly.
  83.  * If so, call this from a handler, and then immediately return OK.
  84.  */
  85.  
  86. void internal_redirect (char *new_uri, request_rec *);     
  87.  
  88. #ifdef CORE_PRIVATE
  89. /* Function called by main.c to handle first-level request */
  90. void process_request (request_rec *);     
  91. int default_handler (request_rec *);
  92. #endif
  93.